home *** CD-ROM | disk | FTP | other *** search
-
- ============ ======== ======= ========= =========
- == == == == == == == == ==
- == == == == == ======= ======== ===== ==
- == == == == == == == == ==
- == == == ======== == == ======== =========
-
-
- ===========================================
- \ /
- \ /
- ----- MORE-C -----
- / | Library Routines | \
- / | By Bill Thousand | \
- ---- | | ----
- / | | Version 1.1 | | \
- \ | | | | /
- ---- | November 16, 1985 | ----
- \ | | /
- \ | (C) Copyright 1985, Bill Thousand | /
- ----- All Rights Reserved -----
- / \
- / \
- ===========================================
-
-
-
- =======================================================
- | This program is distributed under the concept of |
- | PUBLIC DOMAIN SOFTWARE. Please show your support |
- | for the author by registering this product. |
- =======================================================
-
-
-
-
-
-
-
-
- ========================================
- Bill Thousand
- 5585 Riveredge Rd.
- Waunakee, Wis. 53597
- (608) 849-5038
-
-
-
-
- What you have :
- ===============
-
- The MORE-C routines should be distributed in library
- form, using ARC or LU/SQ. The library or archieve should
- include the following :
-
- MORE-C.LIB .... The main functions library
- MORE-C.DOC .... This documentation
- RDCHAR2.OBJ .... Replacement for rdchar w/ status line
- MORE-C.H .... #include file for use with MORE-C
-
-
- Introduction :
- ==============
-
-
- MORE-C is a library of common and very useful 'C'
- functions that can be used in almost any application. The
- only area not supported by MORE-C is graphics.
-
- The base of the entire MORE-C library is the display
- function which puts strings on the screen aprox. 39 times
- faster than "printf". This function makes the application
- look crisper and more professional, since a full screen of
- data appears almost instantly.
-
- The More 'C' library is being distributed under the
- User-Supported Concept. You are asked to make a donation if
- you use the routines in any capacity. See the section on
- "Registration" for more information.
-
-
-
- Short History :
- ===============
-
- Almost all the functions in the MORE-C library were
- written separately and with no intent on being used together.
- This is the first PUBLIC release of the MORE-C library. I
- have been using it for some time and now feel that the
- functions are ready for release (The biggest part of deciding
- to release the the routines depended on finding time to write
- this manual).
-
- I am constantly making updates, and after substantial
- changes I will send a new version to the registered users
- (See the section on "Registration").
-
-
-
-
-
-
- Errors and Illegal Parameters :
- ===============================
-
- In writing the functions that make up MORE-C, I
- made no attempt to trap errors or illegal parameters.
- Therefore, the function will attempt to act on any parameters
- you send it. Example :Telling the menu function that it has 0
- items could produce strange results. Also, currently the
- MORE-C library does not contain any file in/output
- routines, so, most of the general errors are not because of
- the MORE-C functions, but, if errors do occur the MORE-C
- functions will not acknowledge them and could screw up the
- system.
-
-
-
- Requirements :
- ==============
-
- The MORE-C library functions were written to be
- compatible with the IBM-PC or Compaq. The functions should be
- compatible with any IBM-PC Compatible, but, I have no way of
- test them all out.
-
- I wrote the routines using the new Microsoft 'C'
- Compiler version 3.0. This compiler is definitely required if
- you are planning to order the source and modify it, but, as
- for actually using the library with other compilers, I really
- don't know. One thing that can be noted is that to most
- compilers the functions will all have a preceding underscore
- character (The Microsoft compiler automatically assumes an
- underscore preceding every function) EX: The manual will say
- the function is called "purcur(xx,xx)" but, to most compilers
- (not Microsoft 3.0) this will really be stated as
- "_putcur(xx,xx)".
-
- The requirements for MORE-C are as follows :
-
- IBM-PC or Compatible
- 128K RAM
- Microsoft 'C' Compiler Version 3.0
-
-
-
-
- The Functions :
- ===============
-
- Ok, now for the good part. The following is a list and
- brief description of all the functions in the library :
-
- getln ...... Gets a line of text from the user w/full editing
- pause ...... Prompts user to hit any key to continue
- yes_no ..... Prompts user for Yes or No answer
- rdchar ..... Gets a character and scan code from the keyboard
- drawbox .... Draws a window like box on the screen
- logo ....... Displays a logo screen w/Program, author & Ver. & Cpyrt.
- menu ....... Allows great up/down arrow key menus
- get_cur .... Returns the position of the cursor
- putcur ..... Puts the cursor at a specified position
- tone ....... Sounds a short deep tone
- line ....... Draws a single bar line at a specified row
- beep ....... Sounds the normal Ctrl-G bell
- home ....... Clears the screen and returns the cursor to 0,0
- dpl ........ Displays a string on the screen (Very Fast !!)
- dpl_two .... Displays two strings next to each other
- dpli ....... Displays an integer value
- cdpl ....... Centers and displays a string on the screen
- statalt .... Returns status of the ALT key
- statnum .... Returns numlock status
- statcaps ... Returns capslock status
- statctrl ... Returns status of the CTRL key
- statlshft .. Returns status of the Left shift key
- statrshft .. Returns status of the Right shift key
- changstat .. Quick check on all status indicators
-
- videotype .. Determine Display Type
- - This must be the first MORE-C function
- called in the program.
-
- MORE-C.H ... Must be #included in the source code of any
- application using MORE-C
-
-
-
-
- MORE-C.H :
- ==========
-
- This file must be "#included" in any application using
- the MORE-C Library. Currently this file does not do much as
- far as setup, but, it is in my plans to use it more. In this
- release this file is so minor it should not be a problem.
-
- Please do not change any variables in this file. As
- changes occur, I will document anything necessary.
-
- The following are defined in MORE-C.H :
-
- EOL '\0'
- SPACE 32
- DEL 127
- CR 13
- LF 10
- BEL 7
- FALSE 0 -| Must not be redefined !!!
- TRUE 1 -|
-
- Videotype :
- ===========
-
- This function must be called before using any of the
- other MORE-C functions. See the full description on how
- to implement it, but, I recommend you use it just
- after defining your variables in your "main()" function.
-
- Also, you must use the variable "video" witch is defined
- in MORE-C.H !!!! This is very important for correct results.
-
- The Functions :
- ===============
-
- Now for the functions. Each page will contain the
- function name, the synopsis, a description, and any notes
- or problems with the routine.
-
-
-
- **********************************************************************
- *
- * name : videotype
- *
- * synopsis : video=videotype();
- *
- * description : This routine is used by many of the other routines
- * that need to know where the screen memory location
- * begins. This must be the first function used from
- * this library.
- *
- * example :
- *
- * main()
- * {
- *
- * video = videotype();
- *
- * . . .
- * . . .
- * . . .
- *
- * }
- *
- * important : This routine must be run before any others !!!
- *
- * Also, the variable "video" is defined in MORE-C.H and
- * must be used as shown in the example.
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : home
- *
- * synopsis : home();
- *
- * description : This routine clears the screen and puts the cursor at
- * position ( 0,0 ).
- *
- **********************************************************************
-
-
-
- **********************************************************************
- *
- * name : getln
- *
- * synopsis : getln(buff,maxlen,row,col,atr,dflt)
- * char buff[]; /* Array to put text into */
- * int maxlen; /* Length of line to return */
- * int row,col; /* Location on screen for input */
- * char dflt[]; /* Default Data (can be NULL) */
- * int atr; /* Screen Attribute */
- *
- * description : This function gets a line of text from the user with
- * full editing and a limit of specified length.
- *
- * notes : Editing features are :
- *
- * Right Arrow - Move one space right (wraps around)
- * Left Arrow - Move one space left
- * Ctrl-Rt Arrow - Move one word right
- * Ctrl-Lt Arrow - Move one word left
- *
- * Also - Space, backspace, return, Insert, & Delete
- *
- * This function will return the scan code of any
- * extended keys pressed (F1,F2,Alt-F1,Alt-F2)
- *
- * The default string must be NULL ( 0x00 ) terminated !!!
- *
- * extra : The following variables, defined in MORE-C.H, can be used
- * with getln : ( >> is default )
- *
- * eol_pause - >>TRUE: Requires the user to hit return at the
- * of the input line
- * FALSE: Automatically returns when field is full
- *
- * dots - >>TRUE: Fills input space with dots ( . )
- * FALSE: Fills input space with spaces
- *
- * num_only - TRUE: Only allows Numbers to be entered
- * >>FALSE: Allows all letters & numbers
- *
- * upper_case - TRUE: Converts input to all upper case
- * >>FALSE: Allows both upper and lower case
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : pause
- *
- * synopsis : pause(line);
- * int line;
- *
- * description : This function centers a "Hit any key to Continue"
- * message on the specified line and waits for a keypress
- *
- **********************************************************************
-
-
-
-
- **********************************************************************
- *
- * name : yes_no
- *
- * synopsis : yes_no(row,col);
- * int row,col;
- *
- * description : This function puts the cursor at "row,col" and waits
- * for "YyNn" from the user. It returns a 1 if YES and
- * 2 for no.
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : rdchar
- *
- * synopsis : rdchar(&scan,&asci);
- *
- * description : This routine waits for the user to press a key and
- * then inserts the values in the given variables.
- *
- * example :
- * main()
- * {
- * short scan,asci;
- *
- * rdchar(&scan,&asci);
- *
- * }
- *
- * This example gets a keystroke from the user and puts the
- * scan code and ascii value in the variables "scan" & "asci".
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : menu
- *
- * synopsis : menu(row,col,itms);
- * int row,col;
- * int itms; /* Number of items in the menu */
- *
- * description : This routine creates menus and gets a selection from
- * the user.
- *
- * This function returns the item that was selected
- * on a scale from 1 to "itms".
- *
- * notes : Positioning :
- *
- * row = top row
- * row+itms-1 = last or bottom row
- * col = position of solid vertical bar. To the left of
- * the bar, the user moves the pointer up & down.
- * So, "col" must not be less than 3.
- *
- * This routine is directed at situations in which you
- * would want to take a list of item (such as file names)
- * that will vary from time to time and create a menu.
- * I would not recommend this routine for a main menu or
- * function selection routine because it's so generic looking.
- *
- * future
- * outlook : Currently changing the routine to return function keys
- * pressed during selection.
- *
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : dpl
- *
- * synopsis : dpl(string,row,col,attr);
- * char string[xx]; /* string less than 80 cols */
- * int row,col,attr;
- *
- * description : This routine uses the new Microsoft 'C' 3.0
- * "movedata" function to move the string directly to the
- * screen memory area.
- *
- * notes : Even if you don't see anything else in this library
- * that looks useful, it is still worth the slight disk
- * disk space needed to compile with this library for this
- * function alone.
- *
- * Because of the fact that the routine does not rely on
- * DOS or any of it's interrupts to get the string to the
- * screen, this is the absolute fastest way to get data
- * to the screen.
- *
- * Benchmark : printf() (customized for speed)
- * 13 seconds to fill entire screen with 0s
- *
- * dpl()
- * .34 seconds to fill entire screen with 0s
- *
- * dpl() is approx. 39X faster than printf() customized for speed.
- *
- * limitations :
- * Since dpl() moves the string to the screen without going
- * through DOS, it also moves all characters literally. So,
- * any control characters such as CR LF FF or BS will be
- * displayed literally and should be stripped off before using
- * dpl().
- *
- * dpl has no effect on the cursor. The cursor will be
- * in the same position on the screen no matter where you
- * put the string.
- *
- * Also, there is no screen location pointer. You must specify
- * the row and column (from 0 to 24 and from 0 to 79) each
- * time you call the routine. It will not scroll the screen
- * up at when a string is placed at the bottom.
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : cdpl
- *
- * synopsis : cdpl(string,row,attr);
- * char string[xx]; /* must be less than 80 */
- * int row,att;
- *
- * description : This routine uses dpl, but, will automatically calculate
- * the column required to center the string on an 80 col screen.
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : dpli
- *
- * synopsis : dpli(integer,row,col,attr);
- * int integer,row,col,attr;
- *
- * description : This routine uses dpl() to put a integer on the screen
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : dpl_two
- *
- * synopsis : dpl_two(string1,string2,row,col,attr);
- * char string1[xx],string2[xx];
- * int row,col,attr;
- *
- * description : This function uses dpl to put two strings on the screen.
- * the location for "string2" will be automatically calculated
- * to be one space to the right of "string1".
- *
- **********************************************************************
-
-
-
- **********************************************************************
- *
- * name : box_1
- *
- * synopsis : box_1(trow,tcol,vlen,hlen,attr);
- * int trow,tcol; /* Top corner of box */
- * int vlen,hlen; /* Width and height of box */
- * int attr; /* Screen attribute for box */
- *
- * description : This routine uses dpl() to produce a nice looking box
- * with IBM Extended character set on the screen almost
- * instantaneously.
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : logo
- *
- * synopsis : logo(titl,author,version,cprt);
- * char titl[xx]; /* Title of the program */
- * char author[xx]; /* Author " " " */
- * char version[xx]; /* Version or release */
- * char cprt[xx]; /* Copyright notice */
- *
- * description : This routine prints an attractive logo for any program.
- *
- * The strings are placed on the screen literally. So, for
- * example :
- *
- * Author would be - strcpy(author,"By John Doe");
- *
- * Version would be - strcpy(version,"Version 4.12");
- *
- * and the Copyright notice might be set by -
- * strcpy(cprt,"(C) Copyright 1985, John Doe");
- *
- * notes : This routine does not pause or wait for a keystroke, but,
- * returns immediately after displaying the logo.
- *
- **********************************************************************
-
-
-
- **********************************************************************
- *
- * name : line
- *
- * synopsis : line(row);
- * int row;
- *
- * description : This routine puts a line on the screen using dpl() and
- * ASCII character 196.
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : beep
- *
- * synopsis : beep();
- *
- * description : This routine moves the cursor off the screen and
- * uses printf() to print a character 07 wich causes
- * a standard beep.
- *
- * important : This routine does re-locate the cursor and does NOT
- * return it to it's original position.
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : tone
- *
- * synopsis : tone();
- *
- * description : This function sounds a dull low sound from the PC's speaker.
- *
- * notes : Unlike beep(), this routine does not move the cursor.
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : putcur
- *
- * synopsis : putcur(row,col);
- * int row,col;
- *
- * description : This routine move the cursor to the specified location
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : getcur
- *
- * synopsis : getcur(&row,&col);
- *
- * description : This routine puts the current cursor location into
- * the specified variables "row" and "col"
- *
- * example :
- * main()
- * {
- * int row,col
- *
- * getcur(&row,&col);
- *
- * }
- *
- * The variables "row" and "col" now contain the current cursor
- * position.
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : stat???? (alt,lshft,rshft,ctrl,num,caps)
- *
- * synopsis : stat????();
- *
- * description : These routines check the status of the specifed key or
- * indicator and returns a TRUE value if the key is on or
- * FALSE if it is off.
- *
- * notes : See the section on the new RDCHAR for more info
- *
- **********************************************************************
-
-
- **********************************************************************
- *
- * name : changstat
- *
- * synopsis : changstat();
- *
- * description : This routine checks the status of all the shift, ctrl,
- * numlock, alt, and capslock keys and toggles lights on
- * and off in cols 40-80 on the bottom line on the screen.
- *
- **********************************************************************
-
-
-
-
- Using the alternate RDCHAR :
- ============================
-
- I have included an alternate rdchar() function for those
- who want the status indicators, but, are not ordering the
- source code.
-
- When "RDCHAR2.OBJ" is added to the library, you will
- be giving up the bottom line on the screen, for the alternate
- routine uses changstat to constantly update the status. Also,
- the new routine will put the time and date (updating time) in
- the bottom left corner of the screen.
-
- Normally putting all the status indicators (such as the
- shift, ctrl, and alt) would cause slower data entry. In this
- routine, I use dpl for everything, and it does not try to
- update the time while a key is being pressed. It works out
- extremly well, I have not noticed any speed decrease while
- using it.
-
- To implement the alternate routine, rename "RDCHAR2.OBJ"
- as "RDCHAR.OBJ". Then use "LIB" (If you do not have the new
- MS LIB, please make a note on the registration form for me to
- do it for you.) to replace the existing "RDCHAR.OBJ" with
- the new one.
-
- Once installed, this will also be the routine used by
- getln().
-
-
- Source Code Available :
- =======================
-
- The source code for the MORE-C routines is available,
- see the section on registration for more information.
-
- If you do obtain the source code, please do not
- re-distribute any modified version of the routines. If you
- make modifications, please send them to me first. I will
- check to make sure the changes will work with anything I
- might do or have done as far as my own modifications.
-
-
- COPYRIGHT :
- ===========
-
- These routines are copyright 1985 by Bill Thousand.
- All rights reserved. You are granted a limited license to
- distribute these routines un-modified, in library form
- only (Source code distribution is prohibited), and only
- on diskettes. (Distribution of hard copies of the
- Documentation or Source Code is also prohibited).
-
- If you use these routines on a regular basis, please
- show your support by registering. Commercial use by non-
- registered users is prohibited.
-
-
- Support :
- =========
-
- All user's can call for info. Only registered users will
- be allowed to get technical support.
-
- Call - (608)-849-5038
-
-
- Registration :
- ==============
-
- General Advantages to registered users :
-
- - Allowed to use the routines for commercial applications
- - Notification of updates
- - Printed/bound User's manual (Fancy Font formated)
- - Discount on all other products by the author
- - Supporting the Concept of PUBLIC DOMAIN SOFTWARE
-
- - When you register, I will send you a new diskette version of
- this manual. On this new version's registration form, you will
- find your personal registration number. This is the version of
- the manual that you distribute to your friends or user's groups.
- Whenever anyone sends me a registration form with your number on
- it, you will receive a check for $5.00.
-
- There exists three types of registration for the MORE-C routines.
- They are a follows :
-
- #1
- ----------
- $20.00 - You are sent a printed/bound copy of the user's manual
- and notified when major modifications have been made.
- Can receive updates for the cost of the diskettes.
-
- #2
- ----------
- $30.00 - You are sent a printed/bound copy of the user's manual
- and automatically sent any updates of the library or
- manual.
-
- #3
- ----------
- $50.00 - You are sent a printed/bound copy of the user's manual,
- the source code, a hard copy of the source, and any
- updates to the library, source, or manual.
-
-
- NOTE: Allow at least 2 to 3 weeks for delivery.
-
-
-
-
- -------------------------------------------------------------------------------
- BT00101
- Send to :
-
- Bill Thousand, Programmer
- 5585 Riveredge Road
- Waunakee, Wi. 53597
-
-
- Check one : ____ Registration Type #1 @ $20.00
-
- ____ Registration Type #2 @ $30.00
-
- ____ Registration Type #3 @ $50.00
-
-
- Name ________________________________________________________
-
- Address _____________________________________________________
-
- City ____________________________________ State __________
-
- Zip _____________ Phone ( _____ ) ______ - __________
-
-
-
- Comments : __________________________________________________
-
- __________________________________________________
-
- __________________________________________________
-
-
- Other 'C' routines you would like to see :
-
- ___________________________________________________
-
- ___________________________________________________
-
- ___________________________________________________
-
-
- -------------------------------------------------------------------------------
-
-
-
-
-
-
-